// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

package com.nnee.p_b.p_b.p_f;

import com.nnee.p_a.p_b.cls_a;
import com.nnee.p_a.p_b.cls_h;
import com.nnee.p_b.p_b.p_e.cls_f;
import com.nnee.p_b.p_b.p_e.cls_g;
import com.nnee.p_b.p_b.p_e.cls_k;
import com.nnee.p_c.cls_b;
import com.nnee.p_c.p_b.cls_d;
import com.nnee.p_fk.p_a.cls_m;
import com.nnee.p_pr.p_a.cls_i;
import com.nnee.p_pr.p_c.cls_l;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Hashtable;
import org.json.JSONException;
import org.json.JSONObject;

// Referenced classes of package com.nnee.b.b.f:
//            a

public class cls_c extends cls_k
{

    protected cls_c(int i1)
    {
        super(i1);
        l = 0;
    }

    private cls_m a(String s, String s1, String s2, String s3)
    {
        Hashtable hashtable = new Hashtable();
        String s4 = com.nnee.p_b.p_b.p_f.cls_a.a().a("/statuses/update.json");
        hashtable.put("status", s);
        if(!com.nnee.p_c.cls_b.a(s1))
            hashtable.put("lat", s1);
        if(!com.nnee.p_c.cls_b.a(s2))
            hashtable.put("long", s2);
        if(!com.nnee.p_c.cls_b.a(s3))
            hashtable.put("vid", s3);
        com.nnee.p_c.p_b.cls_c c1 = com.nnee.p_b.p_b.p_f.cls_a.a().b().a(com.nnee.p_fk.p_a.cls_b.bPOST, s4, hashtable);
        c1.a(true);
        return c1;
    }

    public static com.nnee.p_fk.p_b.cls_a a(String s, String s1, String s2, String s3, String s4, String s5)
    {
        cls_c c1 = new cls_c(4097);
        c1.n = s2;
        c1.m = s1;
        c1.o = s3;
        c1.p = s4;
        c1.q = s5;
        c1.z = s;
        return c1;
    }

    private void a(String s, String s1)
    {
        com.nnee.p_b.p_b.p_f.cls_a.a().a(s, s1);
    }

    private boolean a()
    {
        boolean flag = true;
        String as[] = com.nnee.p_pr.p_c.cls_l.c(com.nnee.p_b.p_a.cls_d.h().a(), z, 1);
        if(as != null && as.length == 2 && !cls_i.e(as[0]) && !cls_i.e(as[1]))
            a(as[0], as[1]);
        else
            flag = false;
        return flag;
    }

    private cls_g b(String s)
    {
        cls_g g1 = null;
        cls_g g2 = new cls_g(1);
        try
        {
            g2.a(com.nnee.p_c.cls_b.c((new JSONObject(s)).optString("id")));
        }
        catch(JSONException jsonexception)
        {
            jsonexception.printStackTrace();
            g2 = g1;
        }
        if(g2 == null || !cls_i.e(g2.b()))
            g1 = g2;
        return g1;
    }

    private cls_m c(String s)
    {
        Object obj = null;
        com.nnee.p_a.p_b.cls_b b1=null;
		try {
			b1 = new com.nnee.p_a.p_b.cls_b("pic", "upload.jpg", new File(s));
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
        cls_a aa[] = new cls_a[1];
        aa[0] = b1;
        cls_h h1 = new cls_h(aa);
        obj = com.nnee.p_b.p_b.p_f.cls_a.a().b().a(com.nnee.p_fk.p_a.cls_b.bPOST, com.nnee.p_b.p_b.p_f.cls_a.a().a("/statuses/upload.json"), ((Hashtable) (obj)), h1);
 
        return ((cls_m) (obj));
 
    }

    protected void a(int i1, Object obj)
    {
        super.a(i1, obj);
        if(n() == 4097 && l == 1)
            g().a(this);
        else
            h();
    }

    public void a(int i1, String s)
    {
        cls_f f1 = com.nnee.p_b.p_b.p_f.cls_a.a().a(i1, s);
        d(f1.h, f1);
    }

    public void a(String s)
    { cls_g g1 = null;
        switch(n())
        {
       
        case 4097:
        	com.nnee.p_g.cls_b.e("BlogTransaction", s);
            if(l != 0 || cls_i.e(n))
                break; /* Loop/switch isn't completed */
            try
            {
                B = com.nnee.p_c.cls_b.c((new JSONObject(s)).optString("upload_image_url"));
                l = 1;
            }
            catch(JSONException jsonexception)
            {
                jsonexception.printStackTrace();
            }
            if(B == null)
                d(-3, null);
            else
            {
            	l = -1;
                g1 = b(s);
            }
        	break;
        default:
        	break;
        }
        
        if(!o())
            if(g1 != null)
                c(0, g1);
            else
                d(-1, null);
       
    }

    public void c()
    {String s;
        if(a()) {
        switch(n()){
        	
        	case 1097:
        		if(l == 0 && !cls_i.e(n))
                {
                    A = c(n);
                } else
                {
                    s = m;
                    if(B != null)
                        s = (new StringBuilder()).append(s).append(' ').append(B).toString();
                    A = a(s, o, p, q);
                }
        		break;
default:
        		
                
        		break;
        }
        
        } else {
        	d(-2, null);
            com.nnee.p_g.cls_b.d("***********", "Error  withou token & secret to send blog");
            return;
        }
        
        if(A != null && !o())
        {
            a(A);
        } else
        {
            d(-4, null);
            h();
        }
 
    }

    private static final String a = "/statuses/upload.json";
    private static final String b = "/statuses/update.json";
    private static final String j = "upload_image_url";
    private static final byte k = 1;
    private cls_m A;
    private String B;
    private byte l;
    private String m;
    private String n;
    private String o;
    private String p;
    private String q;
    private String z;
}
